<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('认证数据分布')" />
</head>
<body class="gray-bg">
     <div class="container-div ibox">
         <input type="hidden" id="startDate" th:value="${startDate}" />
         <input type="hidden" id="endDate" th:value="${endDate}" />
         <input type="hidden" id="provinceCode" th:value="${provinceCode}" />
<!--        <div class="row">-->
<!--            <div class="col-sm-12 select-table table-striped">-->
<!--                <div class="ibox ">-->
                    <div class="ibox-content height-full full-width">
                        <div class="height-full full-width" id="echarts-funnel-chart"></div>
                    </div>
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: echarts-js" />
    <script th:inline="javascript">
        var prefix = ctx + "member/extInfo";

        $(function() {
            loadCityData();
        });

        function loadCityData(){

            var funnelChart = echarts.init(document.getElementById("echarts-funnel-chart"));
            var funneloption = {
                // title : {
                //     text: '漏斗图',
                // },
                tooltip : {
                    show: false,
                    trigger: 'item',
                    // formatter: "{b} : {c}%"
                },
                // legend: {
                //     data : ['展现11','点击','访问','咨询','订单']
                // },
                calculable : true,
                // series : [
                //     {
                //         name:'城市分布',
                //         type:'funnel',
                //         width: '100%',
                //         data:[
                //             {value:60, name:'访问'},
                //             {value:40, name:'咨询'},
                //             {value:20, name:'订单'},
                //             {value:80, name:'点击'},
                //             {value:100, name:'展现'}
                //         ]
                //     }
                // ]
            };

            var url = prefix + '/chartMapCityData'
            $.ajax({
                type: "post",
                url: url,
                data: {
                    "startDate": $("#startDate").val(),
                    "endDate": $("#endDate").val(),
                    "provinceCode": $("#provinceCode").val(),
                },
                success: function(result) {
                    if (result.code == 0) {

                        funneloption.title = {
                            text: result.data.name + '[' + result.data.totalNumber + ']'
                        }

                        funneloption.series = [
                            {
                                name:'城市分布',
                                type:'funnel',
                                width: '70%',
                                left: '10%',
                                height: 'auto',
                                data:result.data.dataList
                            }
                        ]

                        funnelChart.setOption(funneloption);
                        $(window).resize(funnelChart.resize);

                    }
                }
            });

        }

    </script>
</body>
</html>